package org.tong.kafka.consumer;

import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.support.Acknowledgment;

import java.util.List;

//@Component
public class MyKafkaConsumer {

    /**
     * 使用ack进行手动提交
     *
     * @param msgs
     * @param ack
     */
    @KafkaListener(id = "c1", topics = {"test"})
    public void receiveMsg(List<String> msgs, Acknowledgment ack) {
        System.out.println("receiver msgs : " + msgs);
        ack.acknowledge();
    }
}
